package cc.mycraft;

import org.bukkit.Material;

public class DropList {
	
	private Material[] Mr;
	private int Amount;
	private int Div;
	public DropList(Material m,int div) {
		this.Mr=new Material[] {m};
		this.Amount=0;
		this.Div=div;
	}
	
	public Material[] getDrops() {
		return this.Mr;
	}
	
	public void addMaterial(Material m) {
		Material[] nmr = new Material[this.Mr.length+1];
		int i = 0;
		for(;i<this.Mr.length;i++) {
			if(this.Mr[i].equals(m)) {
				return;
			}
			nmr[i]=this.Mr[i];
		}
		nmr[i]=m;
		this.Mr=nmr;
	}
	public int getDropAmount() {
		if(this.Amount/this.Div<1) {
			return 1;
		}
		return this.Amount/this.Div;
	}
	public void setAmount(int amount) {
		this.Amount = amount;
	}
}
